package com.codefish.framework.spring.core.utils;

import com.codefish.framework.spring.beans.factory.support.PropertyValue;

import java.lang.reflect.Field;

/**
 * @author <a href='https://gitee.com/hzf2281'>codefish</a>
 * @version 1.0.0
 * @since 2022/09/24 下午 12:56
 */
public abstract class BeanUtils {
    /**
     * 自动生成一个类的beanName。例如 FooService =》 fooService
     * @param clazz class类型
     * @return
     */
    public static String generateBeanName(Class<?> clazz) {
        String name = clazz.getSimpleName();
        char firstCh = name.charAt(0);
        //the first char to lowCase
        firstCh = (char) ('a' + (firstCh - 'A'));
        return firstCh + name.substring(1);
    }

}
